const AutoImport = require('unplugin-auto-import/webpack')
const Components = require('unplugin-vue-components/webpack')
const {ElementPlusResolver} = require('unplugin-vue-components/resolvers')
// https://github.com/antfu/unplugin-icons
const Icons = require("unplugin-icons/webpack")
const IconsResolver = require("unplugin-icons/resolver")

module.exports = {
    // ...
    lintOnSave: false, // 关闭语法检查
    configureWebpack: {
        plugins: [
            AutoImport({
                resolvers: [
                    ElementPlusResolver(),
                    // 自动导入图标组件
                    IconsResolver({
                        prefix: 'i',
                    }),
                ],
            }),
            Components({
                resolvers: [
                    ElementPlusResolver(),
                    // 自动注册图标组件
                    IconsResolver({
                        // 使用element-plus的图标库
                        // 其他图标库请到 https://icon-sets.iconify.design/
                        enabledCollections: ['ep', 'system-uicons', 'carbon', 'line-md'],
                    }),
                ],
            }),
            // 让unplugin-icons自动安装图标库
            Icons({
                autoInstall: true,
            }),
        ],
    }
}